package com.ssyx.activity.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ssyx.model.activity.ActivityInfo;
import com.ssyx.model.order.CartInfo;
import com.ssyx.model.product.SkuInfo;
import com.ssyx.vo.activity.ActivityRuleVo;
import com.ssyx.vo.order.CartInfoVo;
import com.ssyx.vo.order.OrderConfirmVo;

import java.util.List;
import java.util.Map;

/**
 * ClassName:ActivityInfoService
 * Description:
 *
 * @Author kay
 * @Create 2024/5/5 23:23
 * @Version 1.0
 */
public interface ActivityInfoService extends IService<ActivityInfo> {
    ////活动分页列表
    IPage<ActivityInfo> getPage(Page<ActivityInfo> pageParams);

    //根据活动id获取活动规则数据
    Map<String, Object> findActivityRuleList(Long id);

    //新增活动规则
    void saveActivityRule(ActivityRuleVo activityRuleVo);


    //根据关键字获取sku列表，活动使用
    List<SkuInfo> findSkuInfoByKeyword(String keyword);

    //根据skuId列表获取促销信息
    Map<Long, List<String>> findActivity(List<Long> skuIdList);

    //根据skuId,userId,获取促销与优惠券信息
    Map<String, Object> findActivityAndCoupon(Long skuId, Long userId);

    //获取购物车满足条件的促销与优惠券信息
    OrderConfirmVo findCartActivityAndCoupon(List<CartInfo> cartInfoList, Long userId);

    //购物车商品项cartInfoList 中商品sku的信息,得到这此商品满足的优惠活动,该活动信息封装在类CartInfoVo中
    List<CartInfoVo> findCartActivityList(List<CartInfo> cartInfoList);
}
